<?php
/**
 * Created by PhpStorm.
 * User: albert
 * Date: 18-5-10
 * Time: 下午3:39
 */

return [
    'queuework' => [//消息队列消费者
        'class' => 'yii\swoole\process\QueueProcess',
        'memory' => 512,
        'log_path' => '/data/logs',
        //'processList' => ['inventory' => ['attempt' => 3, 'sleep' => 5, 'delay' => 0, 'worker' => 1]],
        'pidFile' => sys_get_temp_dir() . '/swoolequeue.pid',
    ],
    'backendwork' => [//后台定时任务
        'class' => 'yii\swoole\process\BackendProcess',
        'memory' => 512,
        'pidFile' => sys_get_temp_dir() . '/swoolebackend.pid',
        'log_path' => '/data/logs',
        //'processList' => []
    ],
    'kafkawork' => [//后台定时任务
        'class' => \yii\swoole\kafka\KafkaProcess::class,
        'memory' => 512,
        'pidFile' => sys_get_temp_dir() . '/swoolekafka.pid',
        'log_path' => '/data/logs',
        'boot' => false
    ],
    'moniter' => [
        'class' => \yii\swoole\moniter\MonitProcess::class,
        'pidFile' => sys_get_temp_dir() . '/moniter.pid',
        'reader' => [
            'class' => \yii\swoole\moniter\Collecter\NginxReader::class,
            'goer' => 1,
            'capacity' => 200,
            'path' => '/www/wwwlogs/access.log'
        ],
        'parser' => [
            'class' => \yii\swoole\moniter\Parser\NotParser::class,
        ],
        'writer' => [
            'class' => \yii\swoole\moniter\Exporter\FileWriter::class,
            'goer' => 2,
            'capacity' => 200,
            'path' => '@runtime/logs/access.log'
        ]
    ],
    'reload' => [
        'class' => \yii\swoole\process\InotifyProcess::class,
        'boot' => true
    ],
    'povider' => [
        'class' => \yii\swoole\governance\provider\ProviderProcess::class,
        'ticket' => 60,
        'boot' => true,
    ],
    'mqtt' => [
        'class' => \yii\swoole\mqtt\MqttProcess::class,
        'pipe' => 2,
        'processList' => swoole_cpu_num(),
        'client' => [
            'class' => \yii\swoole\mqtt\MqttClientCtrl::class,
            'host' => '127.0.0.1',
            'port' => 11883,
            'username' => 'admin',
            'password' => '123456',
            'logger' => [
                'class' => \yii\swoole\mqtt\log\EchoLog::class,
                'log_level' => ['ERROR', 'DEBUG']
            ],
            'store' => [
                'class' => \yii\swoole\mqtt\store\MemStore::class,
            ]
        ],
        'boot' => false,
    ]
];